package engine.data.factories;

import ai.AIDebug;
import ai.engine.AIUnit;
import engine.data.Player;
import engine.data.Unit;

public final class UnitFactory {

	private static byte currId = 0;

	private UnitFactory() {
		// no constructor
	}

	public static Unit getUnit(final Player player, final byte typeId) {
		Unit unit;
		if (player==null || player.type!=Player.COMPUTER){
			unit = new Unit(player, typeId);
		}
		else{
			unit = new AIUnit(player, typeId);
		}
		unit.setId(currId);
		currId++;
		return unit;
	}

}
